//
//  Person.m
//  DogRule
//
//  Created by gzjd on 2017/5/7.
//  Copyright © 2017年 gzjd. All rights reserved.
//

#import "Person.h"

@implementation Person
@synthesize dog=_dog;
-(void)setDog:(Dog *)dog{
    if(_dog!=dog){
        [_dog release];
        _dog=[dog retain];
        //通知——dog的主人
        [_dog setDelegate:self];
        
    }
}
-(Dog *)dog{
    return _dog;
}
-(void)bark:(Dog *)thisDog count:(int)count{
    NSLog(@"this dog %d bark %d",[thisDog ID],count);
}
-(void)dealloc{
    self.dog=nil;
    [super dealloc];
}
@end
